<?php

class Admin_Form_Eadcontato extends Zend_Form
{
    public function init() {
   	    
        $front = Zend_Controller_Front::getInstance();
        $controller = $front->getRequest()->getControllerName();
        $module = $front->getRequest()->getModuleName();
        $url = $front->getBaseUrl().'/'.$module.'/'.$controller;
        $urlbase = $front->getBaseUrl();
        
        $db = Zend_Db_Table_Abstract::getDefaultAdapter();
        
        $this->setName('form_pdr');
        
        $id = $front->getRequest()->getParam('id', 0);
        
        $el = new Zend_Form_Element_Hidden('CON_ID',array('disableLoadDefaultDecorators' =>true));
        $el->addDecorators(array(array('ViewHelper'),array('Errors')))
            ->addFilter('Int');
        $this->addElement($el);
       
        
        $el = new Zend_Form_Element_Text('ALU_NOM');
        $el->setLabel('Aluno')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('readonly','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('CON_AST');
        $el->setLabel('Assunto')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('readonly','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Textarea('CON_TXT');
        $el->setLabel('Mensagem')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('readonly','');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PRS_NOM');
        $el->setLabel('Professor')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('readonly','');
        $this->addElement($el);

        $el = new Zend_Form_Element_Text('CON_DATHOR');
        $el->setLabel('Data')->setRequired(true)
        ->addFilters(array('StripTags','StringTrim'))
        ->addValidator('NotEmpty');
        $el->setAttrib('class','data');
        $el->setAttrib('readonly','');
        $this->addElement($el);
        
        
        /*
        $btn = new Zend_Form_Element_Submit('Salvar',array('disableLoadDefaultDecorators' =>true));
        $btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setLabel('Salvar');
        $btn->setAttrib('id', 'submitbutton');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        */
        
        $btn = new Zend_Form_Element_Button('Cancelar',array('disableLoadDefaultDecorators' =>true));
        $btn->setDecorators(array(array('Description', array('escape' => false, 'tag' => false))));
        $btn->setDescription('<a href="'.$url.'" class="btn-frm">Voltar</a>');
        $btn->setAttrib('id', 'btncancel');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        
        
    }

}

